package com.chookss.view;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chookss.R;
import com.chookss.view.listener.ShareDialogListener;

import butterknife.BindView;

public class LianxiDialog extends BaseDialog {


    @BindView(R.id.tvTiltle)
    TextView tvTiltle;
    @BindView(R.id.tvSure)
    TextView tvSure;
    private int type;
    private Context context;
    private ShareDialogListener listener=null;
    public LianxiDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_lianxi;
    }

    @Override
    protected void init(View view) {
        initCenter(0.3f);
        tvSure.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener != null) {
                    listener.onClick();
                }
                dismiss();
            }
        });
    }

    public LianxiDialog(@NonNull Context context, String content, ShareDialogListener listener) {
        super(context);
        this.context = context;
        tvTiltle.setText(content);
        this.listener=listener;
    }
    public LianxiDialog(@NonNull Context context, String content) {
        super(context);
        this.context = context;
        tvTiltle.setText(content);
    }
    public LianxiDialog(@NonNull Context context, int type, ShareDialogListener listener) {
        super(context);
        this.context = context;
        this.type = type;
        this.listener=listener;
        if (tvTiltle != null){
            if(type==0){
                tvTiltle.setText("开启练习模式，可进行错题练习。确定开启练习模式？");
            }else if(type==1){
                tvTiltle.setText("开启练习模式，可进行收藏练习。确定开启练习模式？");
            }else{
                tvTiltle.setText("退出练习模式后，题目将自带答案解析，确定退出练习模式？");
            }

        }

    }
}
